package com.wjbgn.bsolver.server.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.time.LocalDateTime;

/**
 * Description: bug回复的用户采纳和无用记录
 * Create Date: 2022-05-11T14:01:17.965
 *
 * @author wjbgn
 * @version 1.0
 */
@Data
@Document(indexName = "bsolver_bug_answer_accept_reject", shards = 3, replicas = 1)
public class BugAnswerAcceptRejectDO {

    @Id
    @Field(type = FieldType.Keyword)
    private String id;

    /**
     * 回复id
     */
    @Field(type = FieldType.Keyword)
    private String answerId;

    /**
     * bugid
     */
    @Field(type = FieldType.Keyword)
    private String bugId;

    public BugAnswerAcceptRejectDO(String answerId, String bugId, String username, Integer isAccept, Integer isReject, LocalDateTime createTime) {
        this.answerId = answerId;
        this.bugId = bugId;
        this.username = username;
        this.isAccept = isAccept;
        this.isReject = isReject;
        this.createTime = createTime;
    }

    public BugAnswerAcceptRejectDO() {
    }

    /**
     * 用户名
     */
    @Field(type = FieldType.Keyword)
    private String username;

    public BugAnswerAcceptRejectDO(Integer isAccept, Integer isReject) {
        this.isAccept = isAccept;
        this.isReject = isReject;
    }

    /**
     * 是否采纳
     */
    @Field(type = FieldType.Integer)
    private Integer isAccept;

    /**
     * 是否无用
     */
    @Field(type = FieldType.Integer)
    private Integer isReject;

    @Field(type = FieldType.Date, format = DateFormat.basic_date_time)
    private LocalDateTime createTime;

    @Field(type = FieldType.Date, format = DateFormat.basic_date_time)
    private LocalDateTime updateTime;

}
